# Standard
from pathlib import Path
import os
import sys

# Third Party
from setuptools import find_packages, setup

ROOT_DIR = Path(__file__).parent
print("Building CUDA extensions")
# Third Party
from torch.utils import cpp_extension

ext_modules = [
    cpp_extension.CUDAExtension(
        "lmcache.c_ops",
        [
            "cuda/pybind.cpp",
            "cuda/mem_kernels.cu"
        ],
        extra_compile_args={
            "cxx": ["-D_GLIBCXX_USE_CXX11_ABI=0"],
            "nvcc": ["-D_GLIBCXX_USE_CXX11_ABI=0"],
        },
    ),
]
cmdclass = {"build_ext": cpp_extension.BuildExtension}

setup(
    packages=find_packages(exclude=("csrc")),
    ext_modules=ext_modules,
    cmdclass=cmdclass,
    include_package_data=True,
)
